<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport"
          content="width=device-width,user-scalable=no, initial-scale=1">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>签约咨询</title>
    <%- include('../../_global/baseLibs') %>
    <link rel="stylesheet"  href="/static/css/mycontract.css" />
    <link href="/static/css/page-main.css" rel="stylesheet"/>
    <style type="text/css">
        .team-profile .first-box{
            height: auto;
            overflow: hidden;
        }
    </style>
</head>
<body>
<section class="page-wrap team-profile">
    <header class="header-box grey fixed">
        <div class="header-content">
            <div class="left-tool">
                <a class="back" href="javascript:void(0);"><i class="iconfont icon-back"></i></a>
            </div>
            <div class="title">签约咨询</div>
        </div>
    </header>

    <div class="member-box">
        <!-- <div class="member-title"><span>团队成员</span></div> -->
        <div class="doctor-list-box">
            <ul id="tdcy">
            </ul>
        </div>
    </div>


</section>

<script type="text/html" id="ysLi">
    <li>
        <a href="javascript:void(0);">
            <img src="/static/images/doctor_image.jpg">
            <div class="text-box">
                <h4 class="h4-title">
                    <span class="name" name="xm"></span>
                    <span name="ksmc"></span>
                    <span name="zcmc"></span>
                </h4>
                <p name="yljgmc"></p>
            </div>
            <!-- <div class="item-after"><i class="iconfont icon-more"></i></div> -->
        </a>
    </li>
</script>
<script type="text/javascript">




    var page_mySignService = (function($, page_mySignService) {


        var cfg_def = {
            queryYsxx: queryYsxx,
            createYsItem: createYsItem,
            viewYsxx: viewYsxx,
        }

        page_mySignService.init = function(cfg){
            $.extend(page_mySignService, cfg_def, cfg);
            page_mySignService.queryYsxx();
            $('.zz-btn').click(function () {
                if ($(this).html() == "展开") {
                    $(this).html("收起");
                    $(".jj-content").css('webkit-line-clamp', '9999');
                } else if ($(this).html() == "收起") {
                    $(this).html("展开");
                    $(".jj-content").css('webkit-line-clamp', '3');
                }
            });
        }

        return page_mySignService;

        /**查询团队医生信息 */
        function queryYsxx() {
            var info = StoreCache.getCache("SignServiceMember");
            page_mySignService.createYsItem(info);
        }

        /**创建医生列表*/
        function createYsItem(ary) {
            if (ary) {
                $.each(ary, function (index, item) {
                    var ysxx = $($("#ysLi").html());
                    $(ysxx).find("p[name],span[name]").each(function () {
                        var name = $(this).attr("name");
                        var text = item[name];
                        $(this).text(text);
                    });
                    ysxx.click(function () {
                        page_mySignService.viewYsxx(item);
                    });
                    $("#tdcy").append(ysxx);
                });
            }
        }

        /**  点击医生列表，跳转查看医生信息  */
        function viewYsxx(item) {
            item.photo = "/static/images/doctor_image.jpg";
            var params ={
                yydm:item.yljgdm,
                ksdm:item.ksdm,
                ysgh:item.ysgh
            }
            $.QuickRemote.AjaxJson({
                funcName:"/api/gzd/getDoctorHxid"
                ,callback: function(result){
                    if(result && result.username){
                        JSBridge.prototype.callHandler("forward",{
                            "type": "Native",
                            "toPage": "easemob",
                            "hasNavigation": "false",
                            "params":{
                                "docId":result.username,
                                "docName":item.xm
                            }
                        });
                    }else{
                        $.QuickAlert.alertFail({
                            content : "此医生没有开通聊天！"
                        });
                    }

                }
                ,params:params
            });

            // StoreCache.setCache("qyfwYsjj", JSON.stringify(item));
            // $.QuickUrlUtils.redirectJSBridge({url: "/html/common/signService/ysjj.html", title: "医生简介"});
        }
    })(jQuery, {});
    


</script>

</body>
</html>